<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="com.manage.messagecollection.CarinformitionVo"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	int pageon = 0;
  	int total = 0;
  	int count = 0;
  	String platenumber = "";
  	String cartype = "";
  	if(request.getAttribute("pageon")!=null){
  		pageon = (Integer)request.getAttribute("pageon");
  	}
  	if(request.getAttribute("total")!=null){
  		total = (Integer)request.getAttribute("total");
  	}
  	if(request.getAttribute("count")!=null){
  		count = (Integer)request.getAttribute("count");
  	}
  	if(request.getAttribute("platenumber")!=null){
  		platenumber = (String)request.getAttribute("platenumber");
  	}
  	if(request.getAttribute("carType")!=null){
  		cartype = (String)request.getAttribute("carType");
  	}
  	if(total==0){
  		pageon=0;
  	}
  	List queryList = (List)request.getAttribute("queryList");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base target="_self"><!-- 解决弹出页提交表单会再弹出一个页面的问题 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="javascript" type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
<script language="javascript" type="text/javascript" src="<%=path%>/js/jquery-1.9.1.min.js"/></script>
<script>
	function reCar(){
		if($('input:radio[name=id]:checked').length==0){
			alert('请选择车辆信息');
			return;
		}else{
			window.returnValue = $('input:radio[name=id]:checked').val();
	    	window.close();
    	}
	}
	$(function(){
		var cartype='<%=cartype%>';
		$('#carType').prepend("<option value=''>请选择</option>");
		$.post(
			"<%=path%>/ajax/findDicByType.action", 
			{
				dicType: 'DIC_CARTYPE'
			},
			function(json){
				var obj = $.parseJSON(json);
				$.each(obj.dicList,function(commentIndex, comment) {
					if(comment.dicvalue==cartype){
						$('#carType').append("<option value='"+comment.dicvalue+"' selected='selected'>"+comment.dicname+"</option>");
					}else{
						$('#carType').append("<option value='"+comment.dicvalue+"'>"+comment.dicname+"</option>");
					}
				})
			},"text"
		);
	});
</script>
<title>Insert title here</title>
<link href="<%=basePath%>/images/css.css" rel="stylesheet" type="text/css">
</head>

<body class="bg_003" bgcolor="#f5f5f5">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="100%" height="30" align="center" >
    <table width="75%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="25"><img src="<%=basePath%>/images/1.png" width="16" height="16"></td>
        <td><h1>车辆基本信息</h1></td>
      </tr>
    </table>
    </td>
    <td align="right"></td>
    <td width="39"></td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="1" bgcolor="#e1e1e2"></td>
        <td height="298" align="center">
        <form id="queryForm" name="queryForm" action="<%=path %>/messagecollection/queryCarinformition.action" method="post">
      	<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#e1e1e1">
		          <tr>
		            <td width="85%" height="31" bgcolor="#f5f5f5" colspan="6">
		              车辆类别：<select name="carinformitionVo.cartype" id="carType">
		              </select>&nbsp;&nbsp;&nbsp;&nbsp;
		              车辆号牌：<input type="text" name='carinformitionVo.platenumber' id='plateNumber' value='黑M'/>&nbsp;&nbsp;&nbsp;&nbsp;
		              <input type="submit" name="searchbutton" id="searchbutton" value=" 查 询 "/>
		            </td>
		          </tr>
	          <tr>
	            <th width="10%" height="31" bgcolor="#f5f5f5">
				序号
	            </th>
	            <th width="15%" height="31" bgcolor="#f5f5f5">
	              车辆类别
	            </th>
	            <th width="15%" height="31" bgcolor="#f5f5f5">
	              车辆号牌
	            </th>	
	            <th width="10%" height="31" bgcolor="#f5f5f5">
	              车辆颜色
	            </th>
	            <th width="10%" height="31" bgcolor="#f5f5f5">
	           	 品牌型号
	            </th>
	            <th width="10%" height="31" bgcolor="#f5f5f5">
	            选择
	            </th>
	          </tr>
	          <%
   				if(queryList!=null&&queryList.size()>0){
   					for(int i=0;i<queryList.size();i++){
   						CarinformitionVo vo = (CarinformitionVo)queryList.get(i);
   			%>
	          <tr>
	            <td width="10%" height="31"  bgcolor="#f5f5f5"><%=i+1 %></td>
	            <td width="15%" height="31"  bgcolor="#f5f5f5"><%=vo.getCartype() %></td>
	            <td width="15%" height="31"  bgcolor="#f5f5f5"><%=vo.getPlatenumber() %></td>
	            <td width="10%" height="31"  bgcolor="#f5f5f5"><%=vo.getColor() %></td>
	            <td width="10%" height="31"  bgcolor="#f5f5f5"><%=vo.getPlatetype() %></td>
	            <td  bgcolor="#f5f5f5"><label><input type="radio" name="id" value="<%=vo.getPlatenumber()+","+vo.getId()%>"/></label></td>
	          </tr>
	          <%}} %>
	          <tr>
	          <td colspan="6" height="31" align="right" bgcolor="#f5f5f5">
					共<%=total %>页&nbsp;&nbsp;&nbsp;第<%=pageon %>页
					<%if(total>0){
						if(pageon != 1) { %>
							<a href="<%=path %>/messagecollection/queryCarinformition.action?carinformitionVo.pageon=1&carinformitionVo.platenumber=<%=platenumber %>&carinformitionVo.cartype=<%=cartype %>">第一页</a> 
							<a href="<%=path %>/messagecollection/queryCarinformition.action?carinformitionVo.pageon=<%=(pageon - 1) %>&carinformitionVo.platenumber=<%=platenumber %>&carinformitionVo.cartype=<%=cartype %>">上一页</a>
						<%} %>
						<%if(pageon != total) { %>
							<a href="<%=path %>/messagecollection/queryCarinformition.action?carinformitionVo.pageon=<%=(pageon + 1) %>&carinformitionVo.platenumber=<%=platenumber %>&carinformitionVo.cartype=<%=cartype %>">下一页</a> 
							<a href="<%=path %>/messagecollection/queryCarinformition.action?carinformitionVo.pageon=<%=total %>&carinformitionVo.platenumber=<%=platenumber %>&carinformitionVo.cartype=<%=cartype %>">最后一页</a>
						<%} 
					}%>
	          </td>
	        </tr>
	        </table>
	        </form>
	        <table width="95%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="50" align="center"><input type="button" name="button" id="button" value=" 确	定 " onclick='reCar()'></td>
            </tr>
          </table>
	        </td>
        <td width="1" ></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="5" height="5"><img src="<%=basePath%>/images/019.jpg" width="5" height="5"></td>
        <td width="5" height="5"><img src="<%=basePath%>/images/020.jpg" width="5" height="5"></td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="603" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="26">&nbsp;</td>
  </tr>
</table>
</body>

</html>